<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery-ui.js"></script>
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/jquery-ui.css" type="text/css" charset="utf-8" />
<?php if(!empty($order_exist))
{ ?>
<div class="row-fluid">
<div class="span12">
<h3> Order Already Placed For This Case</h3>
<hr>
<br>
<br>
<div class="span5">
&nbsp;</div>

<div class="span5">
<label><b>Case No</b> </label>
<input type="text" readonly="readonly" value="<?php echo $case_no;?>" name="case_no"/>

<label><b> Order No.</b></label>
<input type="text" name="order" id="order" value="<?php echo $order_exist->order_no;?>"readonly="readonly"/>
<label><b> Supplier</b></label>
      <?php 
	 	$bl[0] = "Select Supliers";
	   		foreach($supplier as $suppliers){
           
				$bl[$suppliers->id] = $suppliers->name;
			}
			echo form_dropdown('id_supplier', $bl, $order_exist->id_supplier, 'class="span12" data-placeholder="Choose a Supplier" readonly="readonly" style="width:220px;"');  ?>

<label><b>Select Order Date</b></label>
<input type="text" name="date" readonly="readonly" id="order_date"value="<?php echo $order_exist->order_date;?>"/>
<label><b>Expected Date </label>
<input type="text" name="expected_date" readonly="readonly" value="<?php echo $order_exist->expected_date;?>"id="expected_date"/>
</div>
</br>
</br>
 <div class="span12">
<div class="span1"> &nbsp;</div>
<div class="span10">
<table width="100%" class="table table-bordered" >

  <tr class="info">
              <td><b>SL No.</b></td>
			  <td><b>Model No.</b></td>
              <td><b>Part Name</b></td>
              <td><b>Part Code</b></td>
              
             
             </tr>

 <tbody id="p_scents">   
 <?php $count=1;?>
<?php foreach ($part as $parts){?> 
  <tr><label for="p_scnts">
    <td><input type="text" readonly="readonly" value="<?php echo $count;?>" class="span8" name='sl_no[]'  id="sl_no" /></td>
	<td><input type="text"  readonly="readonly"class="span8" value="<?php echo $parts->model;?>" name="model_no[]"  id="model_no" /></td>
    <td><input type="text"  readonly="readonly"class="span8" value="<?php echo $parts->name;?>" id="part_name"  name='part_name[]'/></td>
    <td><input type="text" readonly="readonly" class="span8" value="<?php echo $parts->code;?>" name="part_code[]" id="part_code" /></td>
    

 </label> </tr>
<?php $count=$count+1;?>
<?php } ?>

  </tbody>
</table>
</br>


</div>
</div>
</div>
<? } 

else{  ?>
<div class="row-fluid">
<div class="span12">
<h3> Place Order For Parts</h3>
<hr>
<br>
<br>
<div class="span5">
&nbsp;</div>

<form action="<?php echo site_url();?>/admin/order/place_order/<?php echo $case_id;?>" method="post">
<div class="span3">
<label><b>Case No</b> </label>
<input type="text" readonly="readonly" value="<?php echo $case_no;?>" name="case_no"/>

<label><b> Order No.</b></label>
<input type="text" name="order" id="order" value="<?php echo $order;?>"readonly="readonly"/>
<label><b>Select Supplier</b></label>
      <?php 
	 	$bl[0] = "Select Supliers";
	   		foreach($supplier as $suppliers){
           
				$bl[$suppliers->id] = $suppliers->name;
			}
			echo form_dropdown('id_supplier', $bl, '', 'class="chzn-select span12" data-placeholder="Choose a Supplier" style="width:220px;"');  ?>
&nbsp;&nbsp;<a href="<?php echo site_url();?>/admin/diagnosis/create_supplier">
<i class="icon-edit"></i></a>
<label><b>Select Order Date</b></label>
<input type="text" name="date" id="order_date"/>
<label><b>Expected Date </label>
<input type="text" name="expected_date" id="expected_date"/>
</div>
</br>
</br>
<div class="span4"></div></div>
<div class="span12">
<div class="span1"> &nbsp;</div>
<div class="span10">
<table width="100%" class="table table-bordered" >

  <tr class="info">
              <td><b>SL No.</b></td>
			  <td><b>Model No.</b></td>
              <td><b>Part Name</b></td>
              <td><b>Part Code</b></td>
              
             
             </tr>

 <tbody id="p_scents">   
 <?php $count=1;?>
<?php foreach ($part as $parts){?> 
  <tr><label for="p_scnts">
    <td><input type="text" readonly="readonly" value="<?php echo $count;?>" class="span8" name='sl_no[]'  id="sl_no" /></td>
	<td><input type="text"  readonly="readonly"class="span8" value="<?php echo $parts->model;?>" name="model_no[]"  id="model_no" /></td>
    <td><input type="text"  readonly="readonly"class="span8" value="<?php echo $parts->name;?>" id="part_name"  name='part_name[]'/></td>
    <td><input type="text" readonly="readonly" class="span8" value="<?php echo $parts->code;?>" name="part_code[]" id="part_code" /></td>
    

 </label> </tr>
<?php $count=$count+1;?>
<?php } ?>

  </tbody>
</table>
</br>
<p align="right">
<input type="submit" value="Order" class="btn btn-info"/></p></form>
</div>
</div>
</div>
<?php } ?>
<script type="text/javascript">
$(document).ready(function(){
	$('#order_date').datepicker({ dateFormat: 'yy-mm-dd' });
$('#expected_date').datepicker({ dateFormat: 'yy-mm-dd' });
	
})
</script>